package com.qf.spring.test;

import com.qf.spring.pojo.User;
import com.qf.spring.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * created by 赵文韬 on 2022/3/4 9:21
 */
public class Springtest01 {

    @Test
    public void test01(){

     ApplicationContext context = new ClassPathXmlApplicationContext("applicationcontext.xml");
        UserService bean = context.getBean(UserService.class);
        bean.addUser();
    }
    @Test
    public void test02(){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationcontext.xml");
        User user = context.getBean(User.class);
        System.out.println(user);

    }
}
